<template name="related_object_list">

	<div class="steedos-brand-band slds-brand-band_medium  slds-template_bottom-magnet related_object_list">
		<div class="slds-template__container">
			<div class="shadow listViewManager slds-grid slds-grid--vertical">
				<div class="slds-page-header slds-page-header_joined">
					<div class="slds-grid">
						<div class="slds-col slds-has-flexi-truncate">
							<div class="slds-media slds-no-space slds-grow">
								<div class="slds-media__body">
									<nav role="navigation" aria-label="Breadcrumbs">
										<ol class="slds-breadcrumb slds-list_horizontal slds-wrap">
											<li class="slds-breadcrumb__item slds-text-title_caps">
												<a href="{{record_url}}">{{object_label}}</a>
											</li>
											<li class="slds-breadcrumb__item slds-text-title_caps related-main-record-name" data-name="{{record_name}}">
												<a href="{{record_url}}">{{record_name}}</a>
											</li>
										</ol>
									</nav>
									<h1 class="slds-page-header__title slds-text-color--default slds-p-right--x-small crm-header-title">
										<div class="">
											<span class="">{{related_object_label}}</span>
										</div>
									</h1>
								</div>
							</div>
						</div>
						<div class="slds-col slds-no-flex slds-grid slds-align-top slds-p-bottom_xx-small">
							<div class="slds-button-group" role="group">
							{{#if is_file}}
								{{#if perms "allowCreate"}}
									{{#if recordPerminssion "allowCreateFiles"}}
											<button class="slds-button slds-button_neutral btn-upload-file" title="{{_ "creator_actions_upload_file"}}">
												{{_ "creator_actions_upload_file"}}
												<input type="file" name="file" class="input-file-upload" data-target-object-name="cms_files" data-target-related-field-name="{{relatedFieldName}}">
											</button>
									{{/if}}
								{{/if}}
								{{#if perms "allowDelete"}}
									<button class="slds-button slds-button_neutral delete-related-object-record" data-object-name="{{related_object_name}}" title="{{_ "Delete"}}">
										{{_ "Delete"}}
									</button>
								{{/if}}
							{{else}}
								{{#each actions}}
									{{#if newAction}}
										<button class="slds-button slds-button_neutral add-related-object-record" data-object-name="{{related_object_name}}" title="{{_ "New"}}">
											{{_ "New"}}
										</button>
									{{else}}
										<li class="slds-button slds-button--neutral slds-truncate list-action-custom list-action-custom-{{this.name}}">
											<a href="javascript:void(0);" title="{{this.label}}" class="">
												<div class="slds-truncate" title="{{this.label}}">{{this.label}}</div>
											</a>
										</li>
									{{/if}}
								{{/each}}
							{{/if}}
							</div>
						</div>
					</div>
					<div class="slds-grid">
						<div class="slds-col slds-align-middle">
							<p class="slds-text-body_small tabular_info">{{#if recordsTotalCount}}{{_ "creator_list_item_counts" recordsTotalCount}}{{/if}}</p>
						</div>
						<div class="slds-col slds-no-flex slds-grid slds-align-bottom">
							{{> steedos_button className="slds-m-left_xx-small slds-button_icon-border-filled btn-export_list_view"
									iconCategory="utility" iconName="download" variant="icon" title=(_ "creator_list_export_list_view")}}
							{{> steedos_button className="slds-m-left_xx-small slds-button_icon-border-filled btn-refresh"
								iconCategory="utility" iconName="refresh" variant="icon" title=(_ "creator_refresh")}}
						</div>
					</div>
				</div>
				<div class="slds-grid table-grid-content">
					<div class="slds-col slds-no-space">
						<div class="slds-table tale-content list-table-container td-cell-wrap">
							{{#if isMobile}}
								{{> list options=list_data}}
							{{else}}
<!--								{{> Template.dynamic template="creator_grid" data=list_data}}-->
								{{> steedos_object_listview objectApiName=related_object_name name=name columnFields=columnFields filters=filters sort=sort onModelUpdated=onModelUpdated treeRootFilters=treeRootFilters}}
							{{/if}}
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</template>
